<template>
  <div class="demo">
    <h3>学生姓名：{{name}}</h3>
    <h3>学生年龄：{{age}}</h3>
    <button @click="show">点我提示学生姓名</button>
  </div>
</template>

<script>
export default {
  name: "Student",
  data() {
    return {
      name: "张三",
      age: 18
    };
  },
  methods: {
    show() {
      alert(this.name)
    }
  }
}
</script>

<style scoped>
demo {
  background-color: pink;
}
</style>
